package com.epam.entity;

public class TouristVoucher extends AbstractEntity {

	private int id;
	private Country country;
	private int duration;
	private Type type;
	private Transport transport;
	private Hotel hotel;
	private int cost;
	private boolean lastMinute;

	public enum Type {
		Shopping, Recreation, Sanatorium
	}

	public enum Country {
		France, Turkey, China, Thailand, Czech
	}

	public enum Transport {
		Plane, Train, Ship
	}

	public TouristVoucher() {
	}

	public TouristVoucher(TouristVoucherBuilder builder) {
		id = builder.id;
		duration = builder.duration;
		type = builder.type;
		country = builder.country;
		transport = builder.transport;
		hotel = builder.hotel;
		cost = builder.cost;
		lastMinute = builder.lastMinute;
	}

	public static class TouristVoucherBuilder {
		int id;
		private int duration;
		private Type type;
		private Country country;
		private Transport transport;
		private Hotel hotel;
		private int cost;
		private boolean lastMinute;

		public TouristVoucherBuilder id(int id) {
			this.id = id;
			return this;
		}

		public TouristVoucherBuilder duration(int value) {
			this.duration = value;
			return this;
		}

		public TouristVoucherBuilder type(Type type) {
			this.type = type;
			return this;
		}

		public TouristVoucherBuilder country(Country country) {
			this.country = country;
			return this;
		}

		public TouristVoucherBuilder transport(Transport transport) {
			this.transport = transport;
			return this;
		}

		public TouristVoucherBuilder hotel(Hotel hotel) {
			this.hotel = hotel;
			return this;
		}

		public TouristVoucherBuilder cost(int cost) {
			this.cost = cost;
			return this;
		}

		public TouristVoucherBuilder lastMinute(boolean lastMinute) {
			this.lastMinute = lastMinute;
			return this;
		}
		

		public TouristVoucher build() {
			return new TouristVoucher(this);
		}
		

	}

	public int getDuration() {
		return duration;
	}

	public void setDuration(int duration) {
		this.duration = duration;
	}

	public Type getType() {
		return type;
	}

	public void setType(Type type) {
		this.type = type;
	}

	public Country getCountry() {
		return country;
	}

	public void setCountry(Country country) {
		this.country = country;
	}

	public Transport getTransport() {
		return transport;
	}

	public void setTransport(Transport transport) {
		this.transport = transport;
	}

	public Hotel getHotel() {
		return hotel;
	}

	public void setHotel(Hotel hotel) {
		this.hotel = hotel;
	}

	public int getCost() {
		return cost;
	}

	public void setCost(int cost) {
		this.cost = cost;
	}

	public boolean isLastMinute() {
		return lastMinute;
	}

	public void setLastMinute(boolean lastMinute) {
		this.lastMinute = lastMinute;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
	public String toString(TouristVoucher v) {
		String result = "ID: " + v.getId() + "; Country: " + v.getCountry();
		return result;
	}

}
